class CreateGrades < ActiveRecord::Migration
  def self.up
    create_table :grades do |t|
      t.text :name
      t.string :abbreviation
      t.decimal :numerical_value
      t.boolean :is_passing_grade, :default => false
      t.integer :ordering

      t.timestamps
    end

    add_index(:grades, :name, :unique => true)
    add_index(:grades, :abbreviation, :unique => true)
  end

  def self.down
    remove_index(:grades, :column => :name)
    remove_index(:grades, :column => :abbreviation)
    drop_table :grades
  end
end
